{% extends "base.html" %} {% block title %}Manage Blogs - Admin Panel{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
Admin Panel

{{ get_current_user().name }}

Management
{% include 'admin/_management_sidebar.html' %}

Editorial Management

Review and moderate medical articles submitted by doctors

{% set total = blogs|length %} {% set pending_blogs = blogs|selectattr('status', 'equalto', 'pending')|list %} {% set published_blogs = blogs|selectattr('status', 'equalto', 'published')|list %} {% set rejected_blogs = blogs|selectattr('status', 'equalto', 'rejected')|list %} {% set current_view = request.args.get('view', 'all') %} {% if current_view == 'pending' %} {% set filtered_blogs = pending_blogs %} {% elif current_view == 'published' %} {% set filtered_blogs = published_blogs %} {% elif current_view == 'rejected' %} {% set filtered_blogs = rejected_blogs %} {% else %} {% set filtered_blogs = blogs %} {% endif %}
{% if current_view == 'pending' %} Requested for Publication {% elif current_view == 'published' %} Published Articles {% elif current_view == 'rejected' %} Rejected Articles {% else %} All Articles {% endif %}
{% if filtered_blogs %}
{% for blog in filtered_blogs|sort(attribute='created_at', reverse=True) %} {% endfor %}
# Article Details Author Date Status Actions
{{ loop.index }}
{{ blog.title }}
{{ blog.category }}
{{ blog.doctor.user.name }}
{{ blog.created_at.strftime('%d %b %Y, %H:%M') }} {% if blog.status == 'pending' %} Pending {% elif blog.status == 'published' %} Published {% else %} Rejected {% endif %}
{# Slot 1: open article #} {% if blog.status == 'pending' %}Review{% else %}View{% endif %} {# Slot 2: publish (pending) or delete (else) #} {% if blog.status == 'pending' %}
{% else %} {% endif %} {# Slot 3: reject (pending only) or spacer for column lock-up #} {% if blog.status == 'pending' %} {% else %} {% endif %}
{% else %}
No articles found for this filter

Try another card above to view a different set of posts.

{% endif %}
{% for blog in blogs %} {% endfor %} {% endblock %}